<?php
namespace app\admin\validate;
use think\Validate;

class Task extends Validate
{
    
    protected $rule = [
        'name'  =>  'require',
        'desc'  =>  'require',
        'id'    =>  'require|number',
    ];

    protected $message = [
        'name.require'  => '类型不能为空!',
        'desc.require'  => '描述不能为空!',
        'id.require'    => 'ID不能为空!',
        'id.number'     => 'ID参数错误!',
    ];

    protected $scene = [
        'create'    =>  ['name','desc'],
        'delete'    =>  ['id'],
        'edit'      =>  ['id','name','desc'],
    ];

}